package com.ruoyi.st.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.st.domain.StOrderDetail;
import com.ruoyi.st.mapper.StOrderDetailMapper;
import com.ruoyi.st.service.IStOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单详情 (st_order_detail)Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-06
 */
@Service
public class StOrderDetailServiceImpl implements IStOrderDetailService 
{
    @Autowired
    private StOrderDetailMapper stOrderDetailMapper;

    /**
     * 查询订单详情 (st_order_detail)
     * 
     * @param id 订单详情 (st_order_detail)主键
     * @return 订单详情 (st_order_detail)
     */
    @Override
    public StOrderDetail selectStOrderDetailById(Long id)
    {
        return stOrderDetailMapper.selectStOrderDetailById(id);
    }

    /**
     * 查询订单详情 (st_order_detail)列表
     * 
     * @param stOrderDetail 订单详情 (st_order_detail)
     * @return 订单详情 (st_order_detail)
     */
    @Override
    public List<StOrderDetail> selectStOrderDetailList(StOrderDetail stOrderDetail)
    {
        return stOrderDetailMapper.selectStOrderDetailList(stOrderDetail);
    }

    /**
     * 新增订单详情 (st_order_detail)
     * 
     * @param stOrderDetail 订单详情 (st_order_detail)
     * @return 结果
     */
    @Override
    public int insertStOrderDetail(StOrderDetail stOrderDetail)
    {
        stOrderDetail.setCreateTime(DateUtils.getNowDate());
        return stOrderDetailMapper.insertStOrderDetail(stOrderDetail);
    }

    /**
     * 修改订单详情 (st_order_detail)
     * 
     * @param stOrderDetail 订单详情 (st_order_detail)
     * @return 结果
     */
    @Override
    public int updateStOrderDetail(StOrderDetail stOrderDetail)
    {
        return stOrderDetailMapper.updateStOrderDetail(stOrderDetail);
    }

    /**
     * 批量删除订单详情 (st_order_detail)
     * 
     * @param ids 需要删除的订单详情 (st_order_detail)主键
     * @return 结果
     */
    @Override
    public int deleteStOrderDetailByIds(Long[] ids)
    {
        return stOrderDetailMapper.deleteStOrderDetailByIds(ids);
    }

    /**
     * 删除订单详情 (st_order_detail)信息
     * 
     * @param id 订单详情 (st_order_detail)主键
     * @return 结果
     */
    @Override
    public int deleteStOrderDetailById(Long id)
    {
        return stOrderDetailMapper.deleteStOrderDetailById(id);
    }
}
